{literal}
<script type="text/javascript">$().ready(function(){$('#addProduct').validate();});</script>
{/literal}
<h1>Dodajesz produkt</h1>

<form method="post" enctype="multipart/form-data" id="addProduct">
	<input type="hidden" name="MAX_FILE_SIZE" value="99999999" />
{mainoptions title="Dane dla poszczególnych wersji językowych"}
	{assign var=class value=colapse}
	{foreach from=$languages item=lang}
	{capture assign=title}Dane języka: {$lang->getName()}{/capture}
	{mainoptions title=$title class=$class}
	<table cellpadding="0" cellspacing="0" width="100%" class="commonTable">
		<tr>
			<th>Nazwa</th>
			<td><input type="text" class="{if !isset($required)}required{/if}" name="name[{$lang->getId()}]" /></td>
		</tr>
		<tr>
			<th>Opis</th>
			<td>{capture assign=desc}description_{$lang->getId()}{/capture}{insertFckEditor name=$desc}</td>
		</tr>
		<tr>
			<th>Technologie</th>
			<td>{capture assign=tech}technologies_{$lang->getId()}{/capture}{insertFckEditor name=$tech}</td>
		</tr>
		<tr>
			<th>SEO - description</th>
			<td><textarea name="seo_description[{$lang->getId()}]"></textarea></td>
		</tr>
		<tr>
			<th>SEO - keywords</th>
			<td><textarea name="seo_keywords[{$lang->getId()}]"></textarea></td>
		</tr>
	</table>
	{/mainoptions}
	{assign var=class value=expand}
	{assign var=required value=1}
	{/foreach}
{/mainoptions}

{mainoptions title="Dane ogólne"}
	<table cellpadding="0" cellspacing="0" width="100%" class="commonTable">
		<tr>
			<th>Producent</th>
			<td><select name="id_manufacturer">{foreach from=$manufacturers item=manufacturer}<option value="{$manufacturer->getId()}">{$manufacturer->getName()}</option>{/foreach}</select></td>
			<th>Kategoria</th>
			<td>
				<select name="id_category" class="select required">
					<option value="">wybierz</option>
					{foreach from=$categories item=category}
					{if $category->getChildren()|@count gt 0}
					<optgroup label="{$category->getName()}">
						{foreach from=$category->getChildren() item=child}
						<option value="{$child->getId()}"> - {$child->getName()}</option>
						{/foreach}
					</optgroup>
					{else}
					<option value="{$category->GetId()}">{$category->getName()}</option>
					{/if}
					{/foreach}
				</select>
			</td>
		</tr>
		<tr>
			<th>
				Kod:
			</th>
			<td colspan="3">
				<input type="text" name="code" class="required" />
			</td>
		</tr>
		<tr>
			<th>Obraz:</th>
			<td colspan="3">
				<input type="file" name="main_image" />
			</td>
		</tr>
		<tr>
			<th>Aktywny:</th>
			<td>
				<input type="radio" checked="checked" value="1" id="active_1" name="active" /><label for="active_1">tak</label>
				<input type="radio" value="0" id="active_0"  name="active"  /><label for="active_0">nie</label>
			</td>
		</tr>
		<tr>
			<th>Wyłącz ranking:</th>
			<td>
				
				<input type="checkbox" value="1" name="disable_rank" id="disable_rank"  />
			</td>
		</tr>
		<tr>
			<th>Profesjonaliści</th>
			<td colspan="3">{capture assign=pros}professionalist{/capture}{insertFckEditor name=$pros}</td>
		</tr>

	</table>

{/mainoptions}
{mainoptions}
	<input type="submit" value="Zapisz i przejdź do listy" />
	<input type="button" value="Anuluj" onclick="document.location='{url product=index}'" />
{/mainoptions}
</form>
